#define DEBUG
#include <cstdio>

using namespace std;

const int mods=998244353;

long long qpower(long long a, long long n) {
  if (n==0) {
    return 1;
  }
  long long s=1;
  for (; n>1; n/=2) {
    if (n%2) {
      s = s*a%mods;
    }
    a = a*a%mods;
  }
  return s*a%mods;
}

int main() {
  freopen("pj.in", "r", stdin);
  freopen("pj.out", "w", stdout);

  int t, x;
  scanf("%d %d", &x, &t);
  for (int i=1; i<=t; i++) {
    long long n;
    scanf("%lld", &n);
    printf("%lld\n", qpower(2, (n-1)*(n-1)%(mods-1)));
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
